package com.ashapo.example;

public class Example011Extends {

    public static void main(String[] args) {
        Father cfz = new Father();
        cfz.setName("陈峰展");
        System.out.println("name : " + cfz.getName());

        Son czy = new Son();
        czy.setName("陈昭盈");
        czy.setAge(1);
        System.out.println("name : " + czy.getName());
        System.out.println("age : " + czy.getAge());
    }
}

class Father {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

class Son extends Father{
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
